Command ReferenceHeroku CLIGit · Docker · ContainerClick any command to copy
Heroku CLI Toolbelt Reference
A complete annotated guide to the Heroku Toolbelt — installation across all platforms, application management with Git, and container deployment with Docker. Click any command to copy it to clipboard.
⌕
4
Install methods
2
Deploy strategies
Git
Primary deploy method
🐳
Docker support
Installation
Install the Heroku CLI on your platform
🍎 macOS
🐧 Ubuntu / Debian
⚙️ Arch Linux
📦 npm (ARM / BSD)
🌐 cURL (Unix)
Homebrew (recommended for macOS)
macOS
brew tap heroku/brew && brew install heroku
Snap (Ubuntu 16+)
Ubuntu
sudo snap install --classic heroku
apt-get script
Debian / Ubuntu
curl https://cli-assets.heroku.com/install-ubuntu.sh | sh
yay (AUR — community maintained)
Arch Linux
yay -S heroku-cli
Note
The Arch AUR package is community-maintained, not official Heroku. Verify the PKGBUILD before installing.
npm (required for ARM and BSD)
npm
npm install -g heroku
cURL script (Unix-only, needs sudo)
Unix
curl https://cli-assets.heroku.com/install.sh | sh
Windows incompatible
The cURL install script is Unix-only and requires sudo. Use the npm method on Windows.
First steps after installation
setup
heroku --version
Verify the installation — should return the installed CLI version
verify
heroku login
Login to Heroku — opens a browser for authentication
auth
heroku login -i
Login entirely in the terminal without opening a browser
auth
Login troubleshooting
If you face login issues, rename the netrc file and try again: mv ~/.netrc ~/.netrc.backup && heroku login
Deploy with Git — Workflow
Step-by-step: from local project to live Heroku app
01
Navigate to your project
cd ~/myapp
Enter your application directory before running any Heroku commands.
setup
02
Initialise Git (if not already)
git init
Your project must be a Git repository before Heroku can deploy it.
git
03
Stage and commit your code
git add . && git commit -m "My first commit"
Use git add -f example.json to force-add files listed in .gitignore.
git
04
Create the Heroku app
heroku create appname
Creates the app on Heroku and automatically adds a heroku remote to your Git repo.
heroku
05
Verify the remote was added
git remote -v
Should show a heroku remote pointing to https://git.heroku.com/appname.git.
verify
06
Deploy to production
git push heroku master
Pushes your main branch to Heroku — triggers a build and deploy. Your app is live.
deploy
🔀 Git Deploy — All Commands
git deploy
heroku create appname
Create a new Heroku application named appname
create
git push heroku master
Deploy the master branch to Heroku
deploy
git push heroku master --force
Force-push to Heroku — required when the remote contains work you don't have locally
force
git push heroku testbranch:master
Deploy from a non-master local branch to Heroku's master
branch
heroku git:remote -a thawing-inlet-61413
Add a Heroku remote to an existing app (by app name)
remote
git remote rename heroku heroku-staging
Rename a Heroku remote — useful for managing multiple environments (staging, production)
remote
heroku create --ssh-git
Use SSH git transport instead of HTTPS for all git operations